export const searchProps = [
  {
    type: 'input',
    value: 'userName',
    name: '账号',
    style: {
      width: '180px',
    },
    placeholder: '请输入',
  },
  {
    type: 'select',
    value: 'status',
    name: '状态',
    selectOptions: [
      {
        label: '启用',
        value: 0,
      },
      {
        label: '禁用',
        value: 1,
      },
    ],
    placeholder: '请选择',
    style: {
      width: '180px',
    },
  },
];

const accountTypeMap = {
  0: '管理员账户',
  1: '主账户',
  2: '子账户',
};

export const columns = [
  {
    title: '序号',
    dataIndex: 'index',
    width: 70,
    customRender: (text, record, index) => `${index + 1}`,
  },
  {
    dataIndex: 'userName',
    title: '账号',
    ellipsis: true,
    width: 200,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'nickName',
    title: '昵称',
    ellipsis: true,
    width: 200,
    customRender: (text) => text || '/',
  },
  {
    dataIndex: 'accountType',
    title: '账号类型',
    ellipsis: true,
    width: 200,
    customRender: (text) => accountTypeMap[text] || '/',
  },
  {
    dataIndex: 'status',
    title: '状态',
    ellipsis: true,
    width: 150,
    scopedSlots: { customRender: 'status' },
  },
  {
    dataIndex: 'createTime',
    title: '创建时间',
    ellipsis: true,
    width: 180,
    customRender: (text) => text || '/',
  },
  {
    title: '操作',
    width: 150,
    align: 'center',
    fixed: 'right',
    dataIndex: 'operation',
    scopedSlots: {
      customRender: 'operation',
    },
  },
];
